import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-03-01
 * Time: 23:19
 */
public class Main {
    public static void Hanoi(int n,String a,String b,String c){
        if (n == 1){
            System.out.println(a + " 移动到 " + c);
        }else {
            Hanoi(n - 1,a,c,b);
            System.out.println(a + " 移动到 " + c);
            Hanoi(n - 1,b,a,c);
        }
    }

    public static void main1(String[] args) {
        Hanoi(2,"塔1","塔2","塔3");
    }
    //斐波那契数列
    //递归
    public static int fibonacci(int n){
        if (n == 1 || n == 2){
            return 1;
        }
        return fibonacci(n -1) + fibonacci(n - 2);
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int ret = fibonacci(n);
        System.out.println(ret);
    }
    //递归求 N 的阶乘
    public static int factorial(int n){
        if (n == 1) return 1;
        return factorial(n - 1) * n;
    }

    public static void main3(String[] args) {
        System.out.println(factorial(3));
    }
    //递归打印数字的每一位
    public static void print(int num){
        if (num < 10) {
            System.out.print(num+" ");
            return;
        }
        print(num / 10);
        System.out.print(num % 10+" ");
    }
    public static void main(String[] args) {
        print(1234);
    }
}